#ifndef __COLORING_H__
#define __COLORING_H__

#include "psTypes.h"

class Coloring {
public:
	Coloring(int nInds, int nSteps, 
		 int maxColor, intMatrixType data);
	~Coloring();

	intCubeType getAllColorings();

private:
	int nInds;
	int nSteps;
	int maxColor;
	int numColorPerms;

	intMatrixType data;
	intCubeType allColorings;
	intMatrixType allColorPerms;

        // *** private methods ***

        // Methods for generating coloring
	intMatrixType getInitColoring(intVec colors);
	intMatrixType colorTimeStep(intMatrixType coloring,
		int t, intVec colors);
	void genAllColorings(int t, intMatrixType coloring,
			     intVec colors);
	intMatrixType colorTimeStep(intMatrixType coloring, 
			    int t, int colors[]);

        // Methods for generating permutations of 
        // colorset
        intVec permutations(int k, intVec s);
	void setAllColorPermutations(intVec colors);

        // inline methods
	inline void swap(int &x, int &y) {
		int temp = x;
		x = y;
		y = temp;
	}

	inline void setFactMaxColor() {
		numColorPerms = 1;

		for(int i = 1; i <= maxColor; i++)
			numColorPerms *= i;
	}
};
#endif
